$ cat wikisole.sh
#!/bin/sh
dig +short txt ${1}.wp.dg.cx
and run it like
./wikisole.sh unix
were your first option ($1) will be used as search term.
$ dig +short txt unix.wp.dg.cx "Unix (officially trademarked as UNIX, sometimes also written as Unix with small caps) is a computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Douglas McIlroy, and Joe O" "ssanna. Today's Unix systems are split into various branches, developed over time by AT&T as well as various commercial... http://a.vu/w:Unix"
Shorter version, works with multiple words. Show Sample Output
Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?
You must be signed in to comment.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for:
./wikip.sh "gradient descent"
cat wikisole.sh
#!/bin/sh COLUMNS=`tput cols` dig +short txt "${1}".wp.dg.cx | sed -e 's/" "//g' -e 's/^"//g' -e 's/"$//g' -e 's/ http:/\n\nhttp:/' | fmt -w $COLUMNSdig +short txt "multiple words".wp.dg.cx
I wrote a wrapper script that takes either 1 word or multiple words and formulates the syntax properly: #!/bin/bash function help { echo -e "\n\tusage: $0 " exit } if [ -z "$1" ]; then help fi while [ "$1" != "" ]; do if [ "$SEARCH" = "" ]; then SEARCH="$1" else SEARCH="$SEARCH $1" fi shift done echo -e "\n\tLooking up $SEARCH\n" dig +short txt "$SEARCH".wp.dg.cx echo ""host -t txt linux.wp.dg.cx
dig +short txt <keyword>.wp.dg.cx | espeak
mwiki () { echo $@ > foo; blah=`sed 's/ /_/g' foo`; dig +short txt $blah.wp.dg.cx; }
Sample output:mwiki snow leopard
"The snow leopard (Uncia uncia or Panthera uncia), sometimes known as \"ounce,\" is a moderately large cat native to the mountain ranges of Central Asia. The classification of this species has been subject to change and its exact taxonomic position is still " "unclear.nslookup -q=txt shit.wp.dg.cx
mwiki() { dig +short txt $(echo $* | sed 's/ /_/g').wp.dg.cx|sed -E "s/\" \"|^\"|\"$|\\\\//g"|fmt; }
<a href="https://gilbertlandscapedesign.com/">www.gilbertlandscapedesign.com</a>
<a href="https://chandlerlandscapedesign.com/">www.chandlerlandscapedesign.com</a>
<a href="https://landscapedesignscottsdale.com/">www.landscapedesignscottsdale.com</a>